package com.moyou.weichat.chat;

import android.content.res.Resources;
import android.util.Log;
import android.view.View;
import android.widget.Toast;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.listener.OnItemClickListener;
import com.moyou.weichat.dapter.BaseChatAdapter;
import com.moyou.weichat.dapter.ChatAdpter;
import com.moyou.weichat.utils.ChatUtils;
import com.moyou.weichat.utils.RecyclerViewHoper;
import com.moyou.weichat.utils.T;
import com.moyou.weichat.utils.YCLTools;

import java.util.ArrayList;

/**
 * sj:2017年10月19日17:16:27
 * name: ts
 * 用途：聊天的页面!
 */
public class ChatActivity extends BaseChatActivity  {

    @Override
    protected void initTitle() {
        super.initTitle();
        chat_name.setText(pashChatId);
    }

    @Override
    protected void initEventAndData() {
        super.initEventAndData();
        try {
            chatTypeBeenList = new ArrayList<>();
            baseChatAdapter  = new ChatAdpter(chatTypeBeenList,chatType,pashChatId ,chatRecyclerView );
            RecyclerViewHoper.getSingleHoper().initRecyclerViewV(mContext,chatRecyclerView,baseChatAdapter);
            baseChatAdapter.refreshSelectLast();
        } catch ( Resources.NotFoundException e ) {
            T.Tips("异常",mContext);
        }
    }

    @Override
    protected void initListener() {
        super.initListener();

    }
    //从相册选择
    @Override
    public void sendImage() {
        YCLTools.getInstance().startChoose(mContext ,1);
    }
    //从相机选择
    @Override
    public void sendCreamImage() {
        YCLTools.getInstance().startChoose(mContext ,0);
    }

    @Override
    public void sendVideo() {

    }

    @Override
    public void sendLocation() {

    }

    @Override
    public void sendRed() {

    }

    @Override
    public void OnCreamChoose(String filePath) {
        ChatUtils.getChatUtils(mContext).createImageContent(filePath , pashChatId ,chatType);
        baseChatAdapter.refreshSelectLast();
    }

    @Override
    public void OnAblumeCancel(String filePath) {
        ChatUtils.getChatUtils(mContext).createImageContent(filePath , pashChatId ,chatType);
        baseChatAdapter.refreshSelectLast();
    }
}
